package org.dreamwork.util;

/**
 * Created by IntelliJ IDEA.
 * User: seth
 * Date: 2010-4-24
 * Time: 22:41:57
 */
public class StringUtil {
    public static boolean isEmpty (String str) {
        return str == null || str.trim ().length () == 0;
    }

    public static boolean inArray (String[] array, String text) {
        return inArray (array, text, false);
    }

    public static boolean inArray (String[] array, String text, boolean ignoreCase) {
        for (String s : array) {
            if (ignoreCase && s.equalsIgnoreCase (text)) return true;
            else if (s.equals (text)) return true;
        }
        return false;
    }
}